# import requests
# import random
#
# urls = [f'https://httpbin.org/get?age={random.randint(1,10)}' for i in range(10)]
#
# req_set = set()
# for url in urls:
# 	if url not in req_set:
# 		req_set.add(url)
# 		print(requests.get(url).json())
# 	else:
# 		print('重复请求')

import hashlib
import requests
import random

url = 'https://httpbin.org/post'

res_set = set()
for i in range(10):
	data = {
		'name': '张三',
		'age': random.randint(1,10),
	}
	md5 = hashlib.md5()
	md5.update(str(data).encode('utf-8'))
	if md5.hexdigest() not in res_set:
		res_set.add(md5.hexdigest())
		print(requests.post(url,data=data).json())
	else:
		print('重复请求')